@layout("/common/default.html",{title:'添加',libs:['form']}){
  <form class="layui-form"  lay-filter="layui-form-dict" id="layui-form-dict">
    <!--form表单-->
    <input type="hidden" id="onlyid" name="id" value="${dict.id}">
    <input type="hidden" id="op" name="op" value="${dict.op}">
    <input type="hidden"  name="parent.id" value="${dict.parent.id!}">
    <div class="layui-fluid">
      <div class="layui-card">
        <div class="layui-card-header">基本信息</div>
        <div class="layui-card-body">
          <div class="layui-form-item layui-row">

            <div class="layui-inline layui-col-md9">
              <label class="layui-form-label layui-required">数据值</label>
              <div class="layui-input-block">
                <input type="text" id="value" name="value" value="${dict.value!}" placeholder="请输入" autocomplete="off" class="layui-input" lay-verify="required" required="">
              </div>
            </div>


            <div class="layui-inline layui-col-md9">
              <label class="layui-form-label layui-required">标签名</label>
              <div class="layui-input-block">
                <input type="text" id="label" name="label" value="${dict.label!}" placeholder="请输入" autocomplete="off" class="layui-input" lay-verify="required" required="">
              </div>
            </div>


            <div class="layui-inline layui-col-md9">
              <label class="layui-form-label layui-required">类型</label>
              <div class="layui-input-block">
                <input type="text" id="type" name="type" value="${dict.type!}" disabled autocomplete="off" class="layui-input layui-disabled" lay-verify="required" required="">
              </div>
            </div>


            <div class="layui-inline layui-col-md9">
              <label class="layui-form-label">描述</label>
              <div class="layui-input-block">
                <input type="text" id="description" name="description" value="${dict.description!}" placeholder="请输入" autocomplete="off" class="layui-input" lay-verify="required" required="">
              </div>
            </div>

            <div class="layui-inline layui-col-md9">
              <label class="layui-form-label layui-required">排序</label>
              <div class="layui-input-block">
                <input type="text" id="sort" name="sort" placeholder="请输入" value="${dict.sort!}" autocomplete="off" class="layui-input" lay-verify="required" required="">
              </div>
            </div>
          </div>

        </div>

      </div>
    </div>


    <div class="form-group-bottom" style="z-index: 200" align="center">
      <button class="layui-btn" lay-filter="btnSubmit" lay-submit>&emsp;提交&emsp;</button>
      <button   id="btnclose" class="layui-btn layui-btn-primary"  >&emsp;取消&emsp;</button>
    </div>
  </form>

<script>

  layui.use(['form', 'submitform', 'openLayer','zTree','resAjax'], function () {

    var $ = layui.$,
            form = layui.form,
            submitform = layui.submitform,
            openLayer = layui.openLayer,
            resAjax =layui.resAjax;




      form.on("submit(btnSubmit)", function (data) {
        var field=data.field;
        // 请求后台
        submitform.form('/sys/dict/save',field);
        return false;
      });

    });
</script>

@}
